home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / HYP / C-D / DeveloperStax.cpt / Developer Stack 1.2r / card_29637.txt < prev    next >
Text File  |  1989-02-26  |  4KB  |  104 lines

  1. -- card: 29637 from stack: in.2r
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 2612
  5. -- name: DeleteFile2
  6.  
  7.  
  8. -- part 1 (button)
  9. -- low flags: 00
  10. -- high flags: A003
  11. -- rect: left=82 top=302 right=324 bottom=182
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 1
  15. -- font id: 0
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 16
  19. -- part name: Install
  20. ----- HyperTalk script -----
  21. on mouseUp
  22.   --
  23.   --Original script by Steve Drazga, AnalytX
  24.   --XFCNs used: none
  25.   --XCMDs used: none
  26.   --HANDLERS used: none
  27.   --FUNCTIONS used: installRes
  28.   --
  29.   if the optionkey is down then pass mouseup
  30.   put installres(XCMD,field "name") into it
  31.   put installres(DITL,field "name") into it
  32.   put installres(ALRT,field "name") into it
  33. end mouseup
  34.  
  35.  
  36.  
  37. -- part 2 (button)
  38. -- low flags: 00
  39. -- high flags: A004
  40. -- rect: left=252 top=27 right=52 bottom=351
  41. -- title width / last selected line: 0
  42. -- icon id / first selected line: 0 / 0
  43. -- text alignment: 1
  44. -- font id: 0
  45. -- text size: 12
  46. -- style flags: 0
  47. -- line height: 16
  48. -- part name: try it
  49. ----- HyperTalk script -----
  50. on mouseUp
  51.   if the optionkey is down then edit script of me
  52.   set cursor to 4
  53.   DeleteFile2
  54. end mouseUp
  55.  
  56.  
  57.  
  58. -- part contents for background part 2
  59. ----- text -----
  60. DeleteFile2
  61.  
  62. -- part contents for background part 3
  63. ----- text -----
  64. The DeleteFile XCMD by David Conger is public domain software and may be freely distributed 
  65. (with this documentation).  No Finder replacement stack is complete without one!
  66.  
  67. When invoked, DeleteFile presents the user with a stanard Get File dialog box.  The type of files displayed by the dialog depend on the parameters passed to DeleteFile.  Once a file has been chosen, the user is presented with an alert to confirm the choice to delete the file.  If the user clicks "OK" the file is deleted.
  68.  
  69. Bug reports, comments and requests should be directed to DCONGER via GEnie mail.
  70.  
  71. When using ResEdit or another resource mover to put DeleteFile into your own stacks, be sure to move its associated ALRT and DITL resources.  They are numbered 25057 and 23580 respectively and are both named "DeleteFile."
  72.  
  73.  
  74.  
  75. -- part contents for background part 10
  76. ----- text -----
  77. Syntax:
  78.  
  79. DeleteFile2 ["<type1>"] [,"<type2>"] [,"<type3>"] [,"<type4>"]
  80.  
  81. DeleteFile can be passed up to four optional parameters of file types (file types are four letter designators of, you guessed it, the file's type. e. g. "STAK" for stacks, "APPL" for applications, "TEXT" for text files, "PNTG" for paint files, and so on.)  If DeleteFile is called without parameters, the Get File dialog will present all types of files, including invisible files (such as the Desktop file).  Specifying file types in the parameters will limit the files displayed to the given types.  If more than four parameters are supplied only the first four will be used.  File types must be enclosed in quotes and must by separated by commas if more than one parameter is used.
  82.  
  83. Errors resulting from DeleteFile are reported in the global variable "the result."  Stack developers will not generally need to worry about this as the most common errors (file in use, file locked, disk locked) are handled by DeleteFile, which presents the user with an alert explaining what happened.  If no file was selected or if the user decided not to delete the selected file, this information is also returned in "the result."  These are the error messages which DeleteFile can return:
  84.  
  85.    No file was selected.
  86.    File deletion canceled by user.
  87.    OSErr:  Bad file name
  88.    OSErr:  External file system
  89.    OSErr:  File busy
  90.    OSErr:  File locked
  91.    OSErr:  File not found
  92.    OSErr:  I/O error
  93.    OSErr:  No such volume
  94.    OSErr:  Software volume lock
  95.    OSErr:  Hardware volume lock
  96.  
  97. Once again, DeleteFile handles the errors that are most likely to occur, so the developer will not generally have to worry about       "the result."
  98.  
  99.  
  100.  
  101.  
  102. -- part contents for background part 13
  103. ----- text -----
  104. 21